﻿// <copyright file="OptionsPage.xaml.cs" company="Microsoft Corporation">
// Copyright (c) 2009 Microsoft Corporation All Rights Reserved
// </copyright>
// <author>Michael S. Scherotter</author>
// <email>mischero@microsoft.com</email>
// <date>2010-09-13</date>
// <summary>OptionsPage code behind</summary>

namespace MostPopular
{
    using Microsoft.Phone.Controls;

    /// <summary>
    /// Options page
    /// </summary>
    public partial class OptionsPage : PhoneApplicationPage
    {
        /// <summary>
        /// Initializes a new instance of the OptionsPage class.
        /// </summary>
        public OptionsPage()
        {
            InitializeComponent();

            this.DataContext = App.ViewModel;
        }

        /// <summary>
        /// Update the sharing info when navigating from the Options Page
        /// </summary>
        /// <param name="e">the cancel event arguments</param>
        protected override void OnBackKeyPress(System.ComponentModel.CancelEventArgs e)
        {
            App.ViewModel.UpdateShared();

            base.OnBackKeyPress(e);
        }
    }
}